import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import UserList from '../views/UserList.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: {
      name: 'Login'
    }
  }, {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [{
      path: '/getUserList',
      name: 'UserList',
      component: UserList
    }]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
